package com.easy.mapper;

import com.easy.bean.PetBean;
import com.easy.util.Page;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface PetBeanDao {


    int add(@Param("param") PetBean petBean);

    int del(@Param("id") Integer id);

    int edit(@Param("param") PetBean petBean);

    PetBean one(@Param("id")Integer id);

    List<PetBean> all(@Param("param") PetBean petBean);

    int pageCount(@Param("param") PetBean petBean);

    List<PetBean> page(@Param("page") Page page, @Param("param") PetBean petBean);

    // 统计不同宠物类型的数量（返回key为pet_kind，value为对应数量的Map）
    @MapKey("petKind")
    Map<String, Integer> countPetKind();
}
